<html lang="en" xmlns:th="http://www.thymeleaf.org">
<script src="static/assets/js/jquery.min.js"></script>
<!--最近笔记-->
<div class="row  am-cf">
    <div class="am-u-sm-12 am-u-md-12 am-u-lg-4">
        <div class="widget am-cf">
            <div class="widget-head am-cf">
                <div class="widget-title am-fl">月度财务收支计划</div>
                <div class="widget-function am-fr">
                    <a href="javascript:;" class="am-icon-cog"></a>
                </div>
            </div>
            <div class="widget-body am-fr">
                <div class="am-fl">
                    <div class="widget-fluctuation-period-text">
                        ￥61746.45
                        <button class="widget-fluctuation-tpl-btn">
                            <i class="am-icon-calendar"></i>
                            更多月份
                        </button>
                    </div>
                </div>
                <div class="am-fr am-cf">
                    <div class="widget-fluctuation-description-amount text-success">
                        +￥30420.56

                    </div>
                    <div class="widget-fluctuation-description-text am-text-right">
                        8月份收入
                    </div>
                </div>
            </div>
        </div>

    </div>
    <div class="am-u-sm-12 am-u-md-6 am-u-lg-4">
        <div class="widget widget-primary am-cf">
            <div class="widget-statistic-header">
                本季度利润
            </div>
            <div class="widget-statistic-body">
                <div class="widget-statistic-value">
                    ￥27,294
                </div>
                <div class="widget-statistic-description">
                    本季度比去年多收入 <strong>2593元</strong> 人民币
                </div>
                <span class="widget-statistic-icon am-icon-credit-card-alt"></span>
            </div>
        </div>
    </div>
    <div class="am-u-sm-12 am-u-md-6 am-u-lg-4">
        <div class="widget widget-purple am-cf">
            <div class="widget-statistic-header">
                本季度利润
            </div>
            <div class="widget-statistic-body">
                <div class="widget-statistic-value">
                    ￥27,294
                </div>
                <div class="widget-statistic-description">
                    本季度比去年多收入 <strong>2593元</strong> 人民币
                </div>
                <span class="widget-statistic-icon am-icon-support"></span>
            </div>
        </div>
    </div>
</div>
<!--笔记本列表-->
<div class="row  am-cf">
    <div class="am-u-sm-12 am-u-md-12 am-u-lg-12 widget-margin-bottom-lg">

        <div class="widget am-cf widget-body-lg">

            <div class="widget-body  am-fr">
                <div class="am-scrollable-horizontal ">
                    <table width="100%" class="am-table am-table-compact am-text-nowrap tpl-table-black "
                           id="example-r">
                        <thead>
                        <tr class="am-primary">
                            <th width="60%">笔记本列表</th>
                            <th width="20%">时间</th>
                            <th width="20%">操作</th>
                        </tr>
                        </thead>
                        <tbody >
                        <tr th:each="notebook:${notebooks}" th:class="${notebookStat.odd}?'gradeX':'even gradeC'">
                            <td th:text="${notebook.title}"></td>
                            <td th:text="${#dates.format(notebook.createDate,'yyyy-MM-dd HH:mm')}">2016-09-26</td>
                            <td>
                                <div class="tpl-table-black-operation">
                                    <a href="/notelist" class="watchnotes" th:data="${notebook.id}">
                                        <i class="am-icon-list" style="color: #00a23f"></i> 查看
                                    </a>
                                    <!--<a href="javascript:;">
                                        <i class="am-icon-pencil"></i> 编辑
                                    </a>-->
                                    <a href="/removenotebook" th:data="${notebook.id}"
                                       class="tpl-table-black-operation-del delbook">
                                        <i class="am-icon-trash"></i> 删除
                                    </a>
                                </div>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
    <!--<div th:replace="ueditor::ueditormode" class="row am-cf ueditor_jj"></div>-->
    <script type="text/javascript">
        $(function () {

            $(".delbook").on("click", function (event) {
                //阻止默认事件
                event.preventDefault();
                //阻止事件冒泡
                event.stopPropagation();

                var todel=confirm('您确定要删除吗？删除后笔记本下的笔记也会删除，且不可恢复！');
                if (todel){
                    if (window.checkSession() == false) {
                        window.location.href = "/";
                    } else {
                        var bookId = $(this).attr("data");
                        var href = $(this).attr("href");
                        $.get(href, {bookId: bookId}, function (result) {
                            $("#content-box").html(result);
                        });
                    }
                }
            });
            $(".watchnotes").on("click", function (event) {
                //阻止默认事件
                event.preventDefault();
                //阻止事件冒泡
                event.stopPropagation();

                if (window.checkSession() == false) {
                    window.location.href = "/";
                } else {
                    var bookId = $(this).attr("data");
                    var href = $(this).attr("href");
                    $.get(href, {bookId: bookId}, function (result) {
                        $("#content-box").html(result);
                    });
                }
            });
        })

    </script>
</html>